<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableGoodsClasses extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_classes', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('分类名称');
            $table->unsignedInteger('parent_id')->comment('父类ID');
            $table->string('goods_class_key', 100)->comment('唯一标识');
            $table->string('icon', 255)->nullable()->comment('图标');
            $table->integer('order')->comment('排序');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态 1 开启 0 禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_classes');
    }
}
